import 'package:fish_redux/fish_redux.dart';

import 'action.dart';
import 'state.dart';

Reducer<EngineerResultViewState> buildReducer() {
  return asReducer(
    <Object, Reducer<EngineerResultViewState>>{
      EngineerResultViewAction.action: _onAction,
      EngineerResultViewAction.onTapStatus: _onTapStatus,
    },
  );
}

EngineerResultViewState _onAction(
    EngineerResultViewState state, Action action) {
  final EngineerResultViewState newState = state.clone();
  return newState;
}

EngineerResultViewState _onTapStatus(
    EngineerResultViewState state, Action action) {
  final EngineerResultViewState newState = state.clone()
    ..model.isSolve = action.payload;
  return newState;
}
